package com.lin.controller;

import com.lin.pojo.MApply;
import com.lin.pojo.PageVo;
import com.lin.service.PDpatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
public class PDpatchController {
    @Autowired
    PDpatchService pDpatchService;

    @GetMapping("/pdpatch.action")
    public PageVo<MApply> queryAuditingByCond(MApply mApply,
                                            @RequestParam(value = "pageno",defaultValue = "1") Integer pageno,
                                            @RequestParam(value = "pagesize",defaultValue = "5")Integer pagesize){
        return pDpatchService.queryAuditingByCond(mApply, pageno,pagesize);
    }
    @GetMapping("/pdpatch.action/{applyId}")
    public MApply queryAllAuditingById(MApply mApply){
        return pDpatchService.queryAllAuditingById(mApply);
    }
    @PutMapping("/pdpatch.action/{applyId}")
    public Map AuditPassByCheckTag(@PathVariable String applyId){
        int num= pDpatchService.AuditPassByCheckTag(applyId);
        Map map=new HashMap();
        map.put("msg","修改失败");
        if(num>0){
            map.put("msg","修改成功");
            map.put("code","1");
        }
        return map;
    }
}
